]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
endSessionDialog: hide app list when there are no apps
authorRay Strode <rstrode@redhat.com>
Mon, 21 Mar 2011 20:11:15 +0000 (16:11 -0400)
committerRay Strode <rstrode@redhat.com>
Tue, 22 Mar 2011 18:22:55 +0000 (14:22 -0400)
We don't want its padding to show up when it shouldn't
be visible.

https://bugzilla.gnome.org/show_bug.cgi?id=641375

js/ui/endSessionDialog.js

index d1fff2d0545e6d0bdc9d6d27a12915a8c75ef40e..55aa05a65df0235f8345ae3bf9a40e0be48fa794 100644 (file)
@@ -288,12 +288,26 @@ EndSessionDialog.prototype = {
         this.contentLayout.add(scrollView,
                                { x_fill: true,
                                  y_fill: true });
+        scrollView.hide();
+
         this._applicationList = new St.BoxLayout({ vertical: true });
         scrollView.add_actor(this._applicationList,
                              { x_fill:  true,
                                y_fill:  true,
                                x_align: St.Align.START,
                                y_align: St.Align.MIDDLE });
+
+        this._applicationList.connect('actor-added',
+                                      Lang.bind(this, function() {
+                                          if (this._applicationList.get_children().length == 1)
+                                              scrollView.show();
+                                      }));
+
+        this._applicationList.connect('actor-removed',
+                                      Lang.bind(this, function() {
+                                          if (this._applicationList.get_children().length == 0)
+                                              scrollView.hide();
+                                      }));
     },
 
     _onDestroy: function() {